﻿using System;
using System.ComponentModel.Composition;
using MEFedMVVM.ViewModelLocator;
using Slf;

namespace Cinch
{
    /// <summary>
    /// A SimpleLoggerFacade based error logger.
    /// This is what Cinch uses by default, you can override
    /// this by supplying a new Cinch.ILogger based service
    /// </summary>
    [PartCreationPolicy(CreationPolicy.Shared)]
    [ExportService(ServiceType.Both, typeof(ILogger))]
    public class WPFSLFLogger : ILogger
    {
        #region Data
        private static Slf.ILogger logger = null;
        private string name = "";
        public string Name 
        { 
            get 
            { return name; } 
        }
        #endregion

        #region Ctor
        static WPFSLFLogger()
        {
            logger = LoggerService.GetLogger();
        }
        #endregion

        #region ILogger Members

        public void Debug(Exception exception)
        {
            logger.Debug(exception);
        }
        public void Debug(object obj)
        {
            logger.Debug(obj);
        }
        public void Debug(string message)
        {
            logger.Debug(message);
        }
        public void Debug(Exception exception, string message)
        {
            logger.Debug(exception,message);
        }
        public void Debug(string format, params object[] args)
        {
            logger.Debug(format, args);
        }
        public void Debug(Exception exception, string format, params object[] args)
        {
            logger.Debug(exception,format, args);
        }
        public void Debug(IFormatProvider provider, string format, params object[] args)
        {
            logger.Debug(provider,format, args);
        }
        public void Debug(Exception exception, string format, IFormatProvider provider, params object[] args)
        {
            logger.Debug(exception, format, provider,args);
        }
        public void Error(Exception exception)
        {
            logger.Error(exception);
        }
        public void Error(object obj)
        {
            logger.Error(obj);
        }
        public void Error(string message)
        {
            logger.Error(message);
        }
        public void Error(Exception exception, string message)
        {
            logger.Error(exception, message);
        }
        public void Error(string format, params object[] args)
        {
            logger.Error(format, args);
        }
        public void Error(Exception exception, string format, params object[] args)
        {
            logger.Error(exception, format, args);
        }
        public void Error(IFormatProvider provider, string format, params object[] args)
        {
            logger.Error(provider, format, args);
        }
        public void Error(Exception exception, string format, IFormatProvider provider, params object[] args)
        {
            logger.Error(exception, format, provider, args);
        }
        public void Fatal(Exception exception)
        {
            logger.Fatal(exception);
        }
        public void Fatal(object obj)
        {
            logger.Fatal(obj);
        }
        public void Fatal(string message)
        {
            logger.Fatal(message);
        }
        public void Fatal(Exception exception, string message)
        {
            logger.Fatal(exception, message);
        }
        public void Fatal(string format, params object[] args)
        {
            logger.Fatal(format, args);
        }
        public void Fatal(Exception exception, string format, params object[] args)
        {
            logger.Fatal(exception, format, args);
        }
        public void Fatal(IFormatProvider provider, string format, params object[] args)
        {
            logger.Fatal(provider, format, args);
        }
        public void Fatal(Exception exception, string format, IFormatProvider provider, params object[] args)
        {
            logger.Fatal(exception, format, provider, args);
        }
        public void Info(Exception exception)
        {
            logger.Info(exception);
        }
        public void Info(object obj)
        {
            logger.Info(obj);
        }
        public void Info(string message)
        {
            logger.Info(message);
        }
        public void Info(Exception exception, string message)
        {
            logger.Info(exception, message);
        }
        public void Info(string format, params object[] args)
        {
            logger.Info(format, args);
        }
        public void Info(Exception exception, string format, params object[] args)
        {
            logger.Info(exception, format, args);
        }
        public void Info(IFormatProvider provider, string format, params object[] args)
        {
            logger.Info(provider, format, args);
        }
        public void Info(Exception exception, string format, IFormatProvider provider, params object[] args)
        {
            logger.Info(exception, format, provider, args);
        }
        public void Warn(Exception exception)
        {
            logger.Warn(exception);
        }
        public void Warn(object obj)
        {
            logger.Warn(obj);
        }
        public void Warn(string message)
        {
            logger.Warn(message);
        }
        public void Warn(Exception exception, string message)
        {
            logger.Warn(exception, message);
        }
        public void Warn(string format, params object[] args)
        {
            logger.Warn(format, args);
        }
        public void Warn(Exception exception, string format, params object[] args)
        {
            logger.Warn(exception, format, args);
        }
        public void Warn(IFormatProvider provider, string format, params object[] args)
        {
            logger.Warn(provider, format, args);
        }
        public void Warn(Exception exception, string format, IFormatProvider provider, params object[] args)
        {
            logger.Warn(exception, format, provider, args);
        }

        public void Log(LogItem item)
        {
            logger.Log(item);
        } 
        #endregion
    }
}
